package com.ostrich.module_home.nominate.adapter.provider

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ostrich.module_home.databinding.HomeItemFollowCardViewBinding
import com.ostrich.module_home.databinding.HomeItemSingleTitleViewBinding
import com.ostrich.module_home.nominate.entity.NominateEntity

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/28 11:00
 * @Description : FollowCardProvider
 */
class FollowCardProvider(override val itemViewType: Int, override val layoutId: Int) :BaseItemProvider<NominateEntity>() {
    override fun convert(helper: BaseViewHolder, item: NominateEntity) {
        helper.getBinding<HomeItemFollowCardViewBinding>()?.viewModel = item
        helper.getBinding<HomeItemFollowCardViewBinding>()?.executePendingBindings()
    }

    override fun onViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        DataBindingUtil.bind<HomeItemFollowCardViewBinding>(viewHolder.itemView)
    }
}